<?php
$matchedList = $_GET["studentAndTeacher"];
?>
<html>
<body>

    <table>
        <tr>
            <td>"Student"</td>
            <td>"Teacher"</td>
        </tr>
    <?php
    foreach($matchedList as $index => $studentTeacher)
    {
        // TODO
        $student = "Test"; // $studentTeacher = "studentName,teacherName"
        $teacher = "Test";
        echo '<tr>';
            echo '<td>$student</td>';
            echo '<td>$teacher</td>';
        echo '</tr>';
    }
    ?>
    </table>

</body>
</html>